package com.ym.medical.domain.param;

import com.ym.common.annotations.CustomConstraint;
import com.ym.common.constant.BeanCovert;
import com.ym.base.enums.FlagEnum;
import com.ym.medical.domain.entity.SubjectEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import static com.ym.common.constant.ValidRule.Add;
import static com.ym.common.constant.ValidRule.Update;

/**
 * 主题对象 subject
 *
 * @author ym
 * @date 2020-08-24
 */
@ApiModel("mobile主题-修改")
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SubjectUpdateMobileParam extends BeanCovert<SubjectEntity>{

    @ApiModelProperty("主键")
    @NotNull(message = "主键不能为空", groups = {Add.class, Update.class})
    private Long id;

    @ApiModelProperty("关联ID")
    @NotNull(message = "关联ID不能为空", groups = {Add.class, Update.class})
    private Long answerId;

    @ApiModelProperty("ID类型")
    @NotEmpty(message = "ID类型不能为空", groups = {Add.class, Update.class})
    @Size(max = 2, message = "ID类型长度超过{max}", groups = {Add.class, Update.class})
    private String answerType;


    @ApiModelProperty("附件ID")
    @Size(max = 500, message = "附件ID长度超过{max}", groups = {Add.class, Update.class})
    private String attrId;

    @ApiModelProperty("评论内容")
    @Size(max = 3000, message = "评论内容长度超过{max}", groups = {Add.class, Update.class})
    private String content;

    @ApiModelProperty("公开状态(00-不公开 01-公开)")
    @Size(max = 2, message = "公开状态长度超过{max}", groups = {Add.class, Update.class})
    @CustomConstraint(FlagEnum.class)
    private String openStatus;

}
